﻿using FrameworkCore.Extensions;
using FrameworkCore.Modules.Startups;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Infrastructure.Startups;

/// <summary>
/// 表示在应用程序启动时注册服务
/// </summary>
public partial class AiBLSmartEduStartup : IAiBLSmartEduStartup
{
    /// <summary>
    /// 添加和配置任何中间件
    /// </summary>
    /// <param name="services">服务描述符的集合</param>
    /// <param name="configuration">应用程序的配置</param>
    public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
    {
        services.AddAiBLSmartEduMvc();

        services.AddWebEncoders();

        services.AddHttpClient();

        services.AddCacheService(configuration);

        services.AddConsumerService(configuration);

        //services.AddDbContextService(configuration); 

        //services.AddRepositoryService(configuration);
    }

    /// <summary>
    /// 配置已添加中间件的使用方式
    /// </summary>
    /// <param name="application">用于配置应用程序请求管道的构建器</param>
    public void Configure(IApplicationBuilder application)
    {
    }



    /// <summary>
    /// 获取此启动配置实现的顺序
    /// </summary>
    public int Order => 1000; //MVC should be loaded last
}
